/*!
 * tykhome - soft_tag.js
 * Author tykhome <yongketian@gmail.com>
 */

var SoftTag = require('../models').SoftTag;

exports.getSoftTagByTagId = function (tagId, callback) {
	SoftTag.find({
		tag_id: tagId
	}, callback);
};

exports.getSoftTagBySoftId = function (softId, callback) {
	SoftTag.find({
		soft_id: softId
	}, callback);
};

exports.removeByTagId = function (tagId, callback) {
	SoftTag.remove({
		tag_id: tagId
	}, callback);
};

exports.newAndSave = function (topicId, tagId, callback) {
	var soft_tag = new SoftTag();
	soft_tag.soft_id = topicId;
	soft_tag.tag_id = tagId;
	soft_tag.save(callback);
};